import {
  axios
} from '@/utils/request'

function list(params) {
  return axios.get('/vehicle-service/idrive/iDriveList', {
    params
  })
}

function enableModel(data) {
  return axios.put('/vehicle-service/idrive/enableModelIDriveLimit', data)
}
function disableModel(data) {
  return axios.put('/vehicle-service/idrive/closeModelIDriveLimit', data)
}
function getEcuConfig(data) {
  return axios.get('/vehicle-service/idrive/getModelEcu', {params:data})
}
function saveModelEcuConfig(modelId, data) {
  return axios.put('/vehicle-service/idrive/model/ecu/idriveConfig/' + modelId, data);
}
function cancelAllModelEcuConfig(modelId, data) {
  return axios.put('/vehicle-service/idrive/model/ecu/idriveConfigAllCancel/' + modelId, data);
}
function getVehiclePattern(modelId) {
  return axios.get('/vehicle-service/idrive/model/info/' + modelId)
}
function getVehicleConfig(data) {
  return axios.get('/vehicle-service/idrive/vehicleList', {params:data})
}
function saveVehiclePattern(modelId, data) {
  return axios.put('/vehicle-service/idrive/updateModelIDriveAttr/' + modelId, data);
}
//修改测试车辆配置模式
function saveTestVehiclePattern(modelId, data) {
  return axios.put('/vehicle-service/idrive/updateTestModelIDriveAttr/' + modelId, data);
}
function saveVehicleConfig(modelId, data) {
  return axios.put('/vehicle-service/idrive/updateVehicleWhiteList/' + modelId, data);
}

export default {
  list,
  enableModel,
  disableModel,
  getEcuConfig,
  saveModelEcuConfig,
  cancelAllModelEcuConfig,
  getVehiclePattern,
  getVehicleConfig,
  saveVehiclePattern,
  saveTestVehiclePattern,
  saveVehicleConfig,
}